﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using You.Niao.ShaFa.Model;
using You.Niao.ShaFa.IDAL;
using DBUtility;
using Common.Base;

namespace You.Niao.ShaFa.DAL
{
    public class CityDAL:SqlConn,ICity
    {
        public List<city> GetList(string FID)
        {
            List<city> list = new List<city>();
            SqlParameter[] pars = { new SqlParameter("@FID", FID) };
            using (SqlDataReader dr = DbHelperSQL.ExecuteReader(ShaFaConn, "select code,name from city where FID=@FID", pars))
            { 
              while(dr.Read())
              {
                  city model = new city();
                  model.code = dr["code"].ToString();
                  model.name = dr["name"].ToString();
                  list.Add(model);
              }
            }
            return list;
        }
    }
}
